#ifndef __MONTH_INCLUDE
#define __MONTH_INCLUDE

#include <cstddef>
#include <cstdio>
#include <iostream>
#include <sstream>

#include "date.h"

#define MAX_DAYS_IN_MONTH 31;

class Month {
        /*
          The month in the year that this instance represents.  
            Must be a value between 1 and 12.
        */
        int monthInYear;

        /*
            The number of days that this month contains.
            Will be a value between 28 and 31.
        */
        int numDays;

        /*
            A pointer to an ordered array containing the days in this month,
            from the first to the last.
        */
        Date* dates;

    public:
        /*
            Constructor that initializes all values to zero
        */
        Month();

        /*
            Destructor that ensures dates is de-allocated
        */
        ~Month();

        /*
            Setter for the monthInYear property.  
            Parameters:  
                int monthInYear - should be a value between 1 and 12
                bool isLeapYear - true if the year containing this 
                        month is a leap year
            Returns: N/A
        */
        void setMonthInYear(int, bool);

        /*
            Creates a Date object for each day in this month, allocated 
              to the dates property
            Parameters:
                int firstDay - the dayInWeek corresponding to the first
                    day in this month
            Returns: N/A
        */
        void generateDates(int);

        /*
            Returns the dayInWeek for the last day in this month
            Parameters: None
            Returns: an int value representing the day of the week for
                the lay day in the month
        */
        int getLastDay();
        
        /*
            Prints the current month's calendar to stdout
            Parameters: None
            Returns: None
        */
        void printMonth();
    private:
        /*
            An array containing the format needed to format a week's worth
              of dates in a sprintf call 
        */
        static char OUTPUT_FORMAT[];

        /*
            Helper function that prints a specific week's worth of days
              to stdout.
            Parameters: A string array of size 7 that contains the strings
              to print.
            Returns: None
        */
        void printDayLine(std::string*);
};

#endif